import * as constants from '../Constants'
import { get, GET_SUPPLIER_LIST, GET_BUYERCONFIRM_LIST } from '../../service/api'


export interface GetSupplierList {
    type: constants.GetSupplierList
    payload: Promise<any>
  }
  
  export interface GetSupplierList_PENDING {
    type: constants.GetSupplierList_PENDING
    payload: Promise<any>
  }
  
  export interface GetSupplierList_FULFILLED {
    type: constants.GetSupplierList_FULFILLED
    payload: any
  }
  
  export interface GetSupplierList_PAGE {
    type: constants.GetSupplierList_PAGE
    payload: any
  }
  
  export type BuyerConfirmAction = GetBuyerConfirmList | 
    GetBuyerConfirmList_FULFILLED | 
    GetBuyerConfirmList_PENDING | 
    GetBuyerConfirmList_PAGE |
    GetSupplierList | 
    GetSupplierList_FULFILLED | 
    GetSupplierList_PENDING | 
    GetSupplierList_PAGE
  
  
  export function getSupplierList(param: any): GetSupplierList {
    return {
      type: constants.GetSupplierList,
      payload: get(GET_SUPPLIER_LIST, param)
    }
  }
  export function pageSupplier(page: any): GetSupplierList_PAGE {
    return {
      type: constants.GetSupplierList_PAGE,
      payload: page
    }
  }

  export interface GetBuyerConfirmList {
    type: constants.GetBuyerConfirmList
    payload: Promise<any>
  }
  
  export interface GetBuyerConfirmList_PENDING {
    type: constants.GetBuyerConfirmList_PENDING
    payload: Promise<any>
  }
  
  export interface GetBuyerConfirmList_FULFILLED {
    type: constants.GetBuyerConfirmList_FULFILLED
    payload: any
  }
  
  export interface GetBuyerConfirmList_PAGE {
    type: constants.GetBuyerConfirmList_PAGE
    payload: any
  }

  export function getBuyerConfirmList(param: any): GetBuyerConfirmList {
    return {
      type: constants.GetBuyerConfirmList,
      payload: get(GET_BUYERCONFIRM_LIST, param)
    }
  }
  export function recordType(param: number): GetBuyerConfirmList_PAGE {
    return {
      type: constants.GetBuyerConfirmList_PAGE,
      payload: param
    }
  }